<template>
  <div class="">
    <header>
      <van-search shape="round" placeholder="搜索" />
    </header>
    <main>
      <div class="nav">
        <div class="swiper">
          <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
            <van-swipe-item>
              <a href="">
                <img src="../../assets/in/banner.png" alt="" />
              </a>
            </van-swipe-item>
            <van-swipe-item>
              <a href="">
                <img src="../../assets/in/banner.png" alt="" />
              </a>
            </van-swipe-item>
            <van-swipe-item>
              <a href="">
                <img src="../../assets/in/banner.png" alt="" />
              </a>
            </van-swipe-item>
          </van-swipe>
        </div>
        <nav>
          <div class="item">
            <img src="../../assets/in/nav1.png" alt="" />
            SEO优化
          </div>
          <div class="item">
            <img src="../../assets/in/nav2.png" alt="" />
            SEO优化
          </div>
          <div class="item">
            <img src="../../assets/in/nav3.png" alt="" />
            快排系统
          </div>
          <div class="item">
            <img src="../../assets/in/nav4.png" alt="" />
            快排系统
          </div>
          <div class="item">
            <img src="../../assets/in/nav5.png" alt="" />
            SEO优化
          </div>
          <div class="item">
            <img src="../../assets/in/nav6.png" alt="" />
            SEO优化
          </div>
          <div class="item">
            <img src="../../assets/in/nav7.png" alt="" />
            SEO优化
          </div>
          <div class="item">
            <img src="../../assets/in/nav8.png" alt="" />
            更多
          </div>
        </nav>
      </div>
      <h3>推荐商品</h3>
      <div class="content">
        <div class="item" @click="$router.push('/indexDetail?type=1')">
          <img src="../../assets/in/uer.png" alt="" />
          <div class="dsc">
            <p>选定的seo优化关键词指...</p>
            <div class="price">￥ 13.00</div>
            <div class="foot">
              <span>成交2万+</span>
              <span>07-22上新</span>
            </div>
          </div>
        </div>
        <div class="item" @click="$router.push('/indexDetail?type=2')">
          <img src="../../assets/in/uer.png" alt="" />
          <div class="dsc">
            <p>专业APP开发...</p>
            <div class="price">￥ 43.00</div>
            <div class="foot">
              <span>成交4万+</span>
              <span>07-21上新</span>
            </div>
          </div>
        </div>
        <div class="item" @click="$router.push('/indexDetail?type=3')">
          <img src="../../assets/in/uer2.png" alt="" />
          <div class="dsc">
            <p>APP定制开发...</p>
            <div class="price">￥ 93.00</div>
            <div class="foot">
              <span>成交5万+</span>
              <span>07-24上新</span>
            </div>
          </div>
        </div>
        <div class="item" @click="$router.push('/indexDetail?type=4')">
          <img src="../../assets/in/uer2.png" alt="" />
          <div class="dsc">
            <p>选定的seo优化关键词指...</p>
            <div class="price">￥ 20.00</div>
            <div class="foot">
              <span>成交1万+</span>
              <span>07-20上新</span>
            </div>
          </div>
        </div>
      </div>
    </main>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {};
  },
  //生命周期 - 创建完成（访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    document.querySelector("#app").style.backgroundColor = "#f6f6f6";
  },
};
</script>
<style scoped lang='less'>
/* @import url(); 引入css类 */
header {
  width: 100%;
  height: 205px;
  background-color: #146fe6;
  .van-search {
    background-color: #146fe6;
  }
}
main {
  padding: 0 15px 17px;
  background-color: #f6f6f6;
  .nav {
    position: relative;
    background-color: #fff;
    .swiper {
      height: 174px;
      width: 345px;
      position: absolute;
      left: 0;
      top: -140px;
      img {
        height: 174px;
        width: 345px;
      }
    }
    nav {
      display: flex;
      flex-wrap: wrap;
      padding: 55px 0 20px;
      .item {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 25%;
        font-size: 9.5px;
        color: #666666;
        img {
          width: 54px;
          height: 54px;
          margin-bottom: 6px;
        }
      }
    }
  }
  h3 {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
  }
  .content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    .item {
      margin-top: 15px;
      background-color: #ffffff;
      border-radius: 4px;
      box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16);
      width: 48%;
      img {
        width: 100%;
        height: 150px;
      }
      .dsc {
        padding: 10px 12px;
        background-color: #fff;
        p {
          text-align: center;
          font-size: 11px;
          text-align: center;
          color: #333333;
        }
        .price {
          margin: 11px 0 9px;
          font-size: 18px;
          font-weight: 700;
          color: #f9572c;
        }
        .foot {
          display: flex;
          justify-content: space-between;
          align-items: center;
          font-size: 9px;
          color: #9d9fab;
        }
      }
    }
  }
}
</style>